home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20000217-20000824 / 000464_news@columbia.edu _Thu Aug 17 10:42:55 2000.msg < prev    next >
Internet Message Format  |  2020-01-01  |  3KB

  1. Return-Path: <news@columbia.edu>
  2. Received: from watsun.cc.columbia.edu (watsun.cc.columbia.edu [128.59.39.2])
  3.     by uhaligani.cc.columbia.edu (8.9.3/8.9.3) with ESMTP id KAA10475
  4.     for <kermit.misc@cpunix.cc.columbia.edu>; Thu, 17 Aug 2000 10:42:55 -0400 (EDT)
  5. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
  6.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id KAA14155
  7.     for <kermit.misc@watsun.cc.columbia.edu>; Thu, 17 Aug 2000 10:42:54 -0400 (EDT)
  8. Received: (from news@localhost)
  9.     by newsmaster.cc.columbia.edu (8.9.3/8.9.3) id KAA16187
  10.     for kermit.misc@watsun.cc.columbia.edu; Thu, 17 Aug 2000 10:14:41 -0400 (EDT)
  11. X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
  12. From: fdc@columbia.edu (Frank da Cruz)
  13. Subject: Re: Newbie question
  14. Date: 17 Aug 2000 14:14:41 GMT
  15. Organization: Columbia University
  16. Message-ID: <8ngs0h$fpp$1@newsmaster.cc.columbia.edu>
  17. To: kermit.misc@columbia.edu
  18.  
  19. In article <8nfroq$n3l$1@samba.rahul.net>,
  20. Clarence Dold  <dold@rahul.net> wrote:
  21. : Frank da Cruz <fdc@watsun.cc.columbia.edu> wrote:
  22. : : Subsequently you found \freplace() (string replacement), not that you need
  23. : : it if you specify break/include sets to \fsplit().  
  24. : Okay, closer all the time.  
  25. : I'm running on Linux at the moment, ckermit 7.0.196.
  26. : The series of logins from a file is working.  The desired process is
  27. : working ;-)
  28. : Now I'm trying to use the new-found split to get rid of the :23 on the
  29. : vline variable.  But I can't figure out how to gracefully discard the
  30. : return from the function.
  31. : #!/usr/bin/kermit +
  32. :     \fsplit(\%1,&a,:,.)
  33. :     echo 0 \&a[0]
  34. :     echo 1 \&a[1]
  35. :     echo 2 \&a[2]
  36. : $ onesplit 192.168.1.27:telnet
  37. : ?Not a command or macro name: "2"
  38. : Command stack:
  39. :   1. File  : /home/users/cdold/onesplit (line 3)
  40. :   0. Prompt: (top level)
  41. : 0 2
  42. : 1 192.168.1.27
  43. : 2 telnet
  44. : It appears that the "count of elements" being returned from fsplit is being
  45. : seen as a command.  I could assign it to a variable, or echo it, but I
  46. : don't see how to discard it cleanly.
  47. : freplace isn't the proper tool, since Solaris seems to return :telnet in
  48. : the vline, and Linux returns :23 in the vline.  Split would be better.
  49. Kermit functions are not commands.  All Kermit functions return values
  50. (numbers or strings).  It would not make sense to use most functions as
  51. commands (\flength(), \fsubstring(), etc), but I can see your point about
  52. \fsplit().  You can use \fsplit(), or any other function that returns a
  53. number, in any context where you could put a number, like:
  54.  
  55.   #!/usr/bin/kermit +
  56.   assert \fsplit(\%1,&a,:,.)
  57.   show array a
  58.  
  59. ("show array a" shows the value of each element of array a.)
  60.  
  61. By the way, \fsplit() has some peculiarities and limitations:
  62.  
  63.   http://www.columbia.edu/kermit/ck70bugs.html
  64.  
  65. that will be addressed in the next release, which will also include the
  66. reverse function: \fjoin(), which turns an array into a string.
  67.  
  68. Watch this space for announcements.
  69.  
  70. - Frank